<template>
  <el-dialog
    :title="addoredit"
    :visible.sync="dialogVisible"
    width="30%"
    :before-close="handleClose"
  >
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="Minio" name="first">
        <Minioview
          @change="offchange"
          :options="options"
          :editdata="editdata"
        />
      </el-tab-pane>
      <!-- <el-tab-pane label="FDS" name="second"> </el-tab-pane> -->
    </el-tabs>
  </el-dialog>
</template>

<script>
// 组件化
import { Minioview, fdsView } from '../conpoment'
export default {
  props: ['editdata', 'options'],
  components: {
    Minioview,
    fdsView
  },
  data() {
    return {
      activeName: 'first',
      editdatag: this.editdata,
      dialogVisible: true,
      title: '',
      code: ''
    }
  },
  computed: {
    addoredit() {
      if (this.editdatag.addroedit == 'add') {
        return (this.title = '新建')
      } else if (this.editdatag.addroedit == 'edit') {
        return (this.title = '编辑')
      }
    }
  },
  methods: {
    offchange() {
      this.$emit('change')
    },
    handleClick(tab, event) {
      console.log(tab, event)
    },
    handleClose(done) {
      this.$confirm('确认关闭？')
        .then((_) => {
          done()
          this.offchange()
        })
        .catch((_) => {})
    }
  }
}
</script>
<style></style>
